ci: Move codestyle and min build to GH actions
authorColin Walters <walters@verbum.org>
Tue, 17 May 2022 00:10:32 +0000 (20:10 -0400)
committerColin Walters <walters@verbum.org>
Tue, 17 May 2022 12:11:09 +0000 (08:11 -0400)
Part of general momentum to leave heavy lifting (e.g. VM tests)
to Jenkins and Prow and use the cheaper/faster GH actions for
plain builds.

.cci.jenkinsfile
.github/workflows/tests.yml
ci/ci-commitmessage-submodules.sh

index 2a64109a1ea0de682506954c2ee0307b2fdda84a..9aab6feb2ba735f8b85917866dd011ab84c63a06 100644 (file)
@@ -1,7 +1,6 @@
 // Documentation: https://github.com/coreos/coreos-ci/blob/main/README-upstream-ci.md
 
 stage("Build") {
-parallel normal: {
   def n = 5
   buildPod(memory: "2Gi", cpu: "${n}") {
       checkout scm
@@ -36,34 +35,6 @@ parallel normal: {
       }
       stash includes: "installed/", name: 'build'
   }
-},
-// A minimal build, helps test our build options
-minimal: {
-  buildPod() {
-      checkout scm
-      shwrap("""
-        git submodule update --init
-
-        env NOCONFIGURE=1 ./autogen.sh
-        ./configure --without-curl --without-soup --disable-gtk-doc --disable-man \
-          --disable-rust --without-libarchive --without-selinux --without-smack \
-          --without-openssl --without-avahi --without-libmount --disable-rofiles-fuse \
-          --without-libsodium
-        make
-      """)
-  }
-},
-codestyle: {
-  buildPod() {
-      checkout scm
-      shwrap("""
-        # Jenkins by default only fetches the branch it's testing. Explicitly fetch main
-        # for ci-commitmessage-submodules.sh
-        git fetch origin +refs/heads/main:refs/remotes/origin/main
-        ci/ci-commitmessage-submodules.sh
-      """)
-  }
-}
 }
 
 // Build FCOS and do a kola basic run
index 8c0ae5f6eecd5bad10d2a76439f17cbef3c4510f..043202b51a8d9ae13fa0a7cc0f2bdacfef177b6a 100644 (file)
@@ -11,6 +11,39 @@ permissions:
   contents: read
 
 jobs:
+  codestyle:
+    name: "Code style"
+    runs-on: ubuntu-latest
+    container: registry.ci.openshift.org/coreos/fcos-buildroot:testing-devel
+    steps:
+      - name: Checkout repository
+        uses: actions/checkout@v2
+        with:
+          fetch-depth: 0
+          submodules: true
+      # https://github.com/actions/checkout/issues/760
+      - name: Mark git checkout as safe
+        run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
+      - name: Test style
+        run: ./ci/ci-commitmessage-submodules.sh
+  minimal:
+    name: "Build - FCOS minimal"
+    runs-on: ubuntu-latest
+    container: registry.ci.openshift.org/coreos/fcos-buildroot:testing-devel
+    steps:
+      - name: Checkout repository
+        uses: actions/checkout@v2
+      # https://github.com/actions/checkout/issues/760
+      - name: Mark git checkout as safe
+        run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
+      - name: Build
+        run: |
+          env NOCONFIGURE=1 ./autogen.sh &&
+          ./configure --without-curl --without-soup --disable-gtk-doc --disable-man \
+          --disable-rust --without-libarchive --without-selinux --without-smack \
+          --without-openssl --without-avahi --without-libmount --disable-rofiles-fuse \
+          --without-libsodium &&
+          make
   tests:
     # Distro configuration matrix
     #
index ebc1802266cf40adc268e3e8fe100380daad4882..95e2433e1664ea90c09d0bbe4c459b8c5dcec3ce 100755 (executable)
@@ -39,6 +39,7 @@ gitdir=$(realpath $(pwd))
 # try to read the submodules from the Internet again.  If we wanted to
 # require a newer git, we could use `git worktree`.
 cp -a ${gitdir} ${tmpd}/workdir
+git config --global --add safe.directory "${tmpd}/workdir"
 cd ${tmpd}/workdir
 git log --pretty=oneline origin/main..$HEAD | while read logline; do
     commit=$(echo ${logline} | cut -f 1 -d ' ')